<?php
/**
 * @name /www/admin/users.php
 * @author
 * @version 2011.03.30
 *
 * This is the admin page to show list of users.
 */

// Sets up configuration settings and includes libraries.
require_once('_ini.php');

// Libraries
ReqLib('/lib/private/Item.php');

function DefineHeader()
{
?>
	<script language="javascript">
		function printDIV()
		{
		    var content = document.getElementById("print_content");
		    var winPrint = window.open('', '', 'left=0,top=0,width=1,height=1,toobar=0,scrollbars=0,status=0');

			winPrint.document.write(content.innerHTML);

			winPrint.document.close();

			winPrint.focus();
			winPrint.print();
			winPrint.close();
		}
	</script>
<?
}
/**
 * Defines page content.
 *
 */
function DefineContent()
{
  // Page content goes here.
  ?>
  <div id="print_content">
  <img src="<?=_webroot('/images/logo.gif') ?>" alt="Logo" />
	  <center><h1>Un Verified Items</h1></center>
		<center>
			<table border="2">
				<tbody>
					<th>Item Id</th>
					<th>Item Name</th>
		<?

			foreach(Item::GetItems() as $i)
			{
				if($i->IsVerified == 1)
				{
					println('<tr>');
					println("<td align=\"center\">{$i->ItemId}</td><td align=\"center\">{$i->Name}</td>");
					println('</tr>');
				}
			}
		?>
				</tboby>
			</table>
		</center>
	</div>
	<center><input type="button" name="print" value="Print" id="printButton" onclick="printDIV();" /></center>
<?
}

// Launches the page; without this, nothing happens.
require_once('_loader.php');